cmake_minimum_required(VERSION 3.0)
project(lr_optimization)

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})

# Eigen3
find_package(Eigen3 REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIR})

# OpenCV
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})

# Ceres
find_package(Ceres REQUIRED)
include_directories(${CERES_INCLUDE_DIRS})

# g2o
find_package(G2O REQUIRED)
include_directories(${G2O_INCLUDE_DIRS})



add_executable(lr_optimization g2o_fit.cpp)


target_link_libraries(lr_optimization
    ${OpenCV_LIBS}
    ${CERES_LIBRARIES}
    ${G2O_CORE_LIBRARY}
    ${G2O_STUFF_LIBRARY}
)

install(TARGETS lr_optimization RUNTIME DESTINATION bin)